
// 小程序状态栏信息
const SYSTEM_INFO = uni.getSystemInfoSync();
export const getStatusBarHeight = () => SYSTEM_INFO.statusBarHeight || 15;

// 小程序胶囊按钮信息
export const getTitleBarHeight = () => {
  if(uni.getMenuButtonBoundingClientRect) {
    const {top,height} = uni.getMenuButtonBoundingClientRect();
    const titleBarHeight = height + (top - getStatusBarHeight()) * 2;
    return titleBarHeight
  } else {
    return 50
  }
}

export const getNavBarHeight = () => getStatusBarHeight() + getTitleBarHeight()